package com.zm.demo.core.leetcode;

/**
 * https://leetcode-cn.com/problems/dungeon-game/ 地下城游戏
 */
public class CalculateMinimumHP {

    //如果在某一时刻降至小于等于0，骑士死亡
    public int calculateMinimumHP(int[][] dungeon) {
        int[][]dp = new int[dungeon.length][];
        dp[0][0] = dungeon[0][0];
        for (int i = 0; i < dungeon.length-1; i++) {
            for (int j = 0; j < dungeon[0].length-1; j++) {
                if ( i != 0 || j != 0){
                    dp[i][j] = Math.max(dungeon[i][j+1], dungeon[j+1][i]);

                }
            }
        }


        int min = dp[0][0] <= 0 ? Math.abs(dp[0][0])+1 : 1;
        for (int i = 1; i < dp.length ; i++) {
            for (int j = 1; j < dp[0].length ; j++) {
//                if ()
            }
        }

        return 0;
    }
}
